package a0.reflection.DynamicProxy;

/**
 * Dynamic Proxy 动态代理：为其他对象提供代理，以控制对这个对象的访问
 **/
public class Test {

    public static void main(String[] args) {
        //创建用来代理对象的对象
        CreateProxy createProxy = new CreateProxy();
        /*Shopping person = new Person();
        Shopping proxy = (Shopping) createProxy.create(person);
        //相当于调用了invoke方法
        proxy.buy();*/

        Travel person = new Person();
        Travel proxy = (Person) createProxy.create(person);
        proxy.ticket();

    }

}
